<MduiDialog @ref="@dialog" Title="Dialog Example">
    <ChildContent>
        <MduiTextField Label="请输入文本" @bind-Value="@text" />
        <MduiField Label="选择">
            <MduiSelect @bind-Value="@value">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
            </MduiSelect>
        </MduiField>
    </ChildContent>
    <ActionsContent>
        <MduiButton DisableRaised OnClick="@Cancel">Cacell</MduiButton>
        <MduiButton DisableRaised OnClick="@Confirm">Confirm</MduiButton>
    </ActionsContent>
    </MduiDialog>

    @code {
    MduiDialog? dialog;
    string? text;
    int value;

    private void Cancel()
    {
        dialog?.Close(DialogResult.Cancel("点击了Cancel按钮"));
    }

    private void Confirm()
    {
        dialog?.Close(DialogResult.Ok("点击了Confirm按钮"));
    }
}